<div ng-include="'components/navbar/navbar.html'"></div>

<div class="w980" style="padding:160px 0">
  <div class="col-sm-offset-7 col-sm-5">
    <form class="form-horizontal" name="userForm" novalidate>
      <div class="form-group">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
          <input type="text" class="form-control" name="email" 
                  ng-minlength="5" ng-maxlength="20" ng-model="user.email" 
                  required placeholder="请输入登陆邮箱" ng-pattern="/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/">
        </div>
        <div class="alert alert-danger col-sm-10" role="alert" 
              ng-show="userForm.email.$dirty&&userForm.email.$error.minlength">邮箱地址长度最小为5位</div>
        <div class="alert alert-danger col-sm-10" role="alert" 
              ng-show="userForm.email.$dirty&&userForm.email.$error.maxlength">邮箱地址长度最大为20位</div>
        <div class="alert alert-danger col-sm-10" role="alert" 
              ng-show="userForm.email.$dirty&&userForm.email.$error.pattern">请输入正确有效邮箱地址</div>
      </div>
      <div class="form-group">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
          <input type="password" class="form-control" name="password" 
                  ng-minlength="3" ng-maxlength="16" ng-model="user.password" 
                  required placeholder="请输入密码">
        </div>
        <div class="alert alert-danger col-sm-10" role="alert" 
              ng-show="userForm.password.$dirty&&userForm.password.$error.maxlength">密码最大长度为16位</div>
        <div class="alert alert-danger col-sm-10" role="alert" 
              ng-show="userForm.password.$dirty&&userForm.password.$error.minlength">密码最小长度为4位</div>
      </div>
      <div class="form-group">
        <div class="input-group col-sm-4" style="float:left">
          <div class="input-group-addon"><span class="glyphicon glyphicon-tags" aria-hidden="true"></span></div>
          <input type="text" class="form-control" name="usercaptcha" ng-model="user.captcha" ng-minlength="1" required placeholder="验证码">
        </div>
        <img ng-src="{{captcha}}" alt="验证码" ng-init="captcha='/img'" style="margin:0 10px 0 20px;float:left">
        <a href="" ng-click="changeCcap()" style="font-size:10px" class="changeCaptcha">看不清 ? 点击我</a>
      </div>
      <div class="form-group" ng-show="userForm.usercaptcha.$error.minlength">
        <div class="alert alert-danger col-sm-10" role="alert">验证码不能为空</div>
      </div>
      <div class="form-group" ng-show="!captchaToltip">
        <div class="alert alert-danger col-sm-10" role="alert">验证码有误 ！</div>
      </div>
      <div class="form-group" ng-show="!userFormToltip">
        <div class="alert alert-danger col-sm-10" role="alert">用户名或密码有误 ！</div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-4 col-sm-3">
          <button type="button" class="btn btn-primary" 
                    ng-disabled="userForm.$invalid" ng-click="login()">&nbsp;&nbsp;登&nbsp;&nbsp;录&nbsp;&nbsp;</button>
        </div>
      </div>
    </form>
  </div>
</div>
<div ng-include="'components/navbar/footer.html'"></div>